CFLAGS = -Wall -std=c99
DEFS = -D_REENTRANT
prefix = /usr
includedir = ${prefix}/include

HOSTARCH = $(shell arch)

ifeq ($(HOSTARCH),x86_64)
LIB_ARCH = lib64
else
LIB_ARCH = lib
endif

makefile: all

all: libpseudo

debug: libpseudo

libpseudo:
	gcc $(CFLAGS) $(DEFS) -c -fPIC *.c `pkg-config --cflags glib-2.0`
	gcc -shared -o libpseudo.so *.o

clean:
	rm -f *.o
	rm -f *.so

install:
	cp -f pseudo.h $(includedir)
	cp -f libpseudo.so ${prefix}/${LIB_ARCH}/
	chmod 755 ${prefix}/${LIB_ARCH}/libpseudo.so
	ldconfig	
	

